package com.myself.common.redisson.config;

import com.myself.common.redisson.client.RedissonLockClient;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author zhangrongjun
 * @version 1.0
 * @date 2024-02-20 17:10
 */
@Slf4j
@Configuration
public class RedissonLockClientConfiguration {

    @Bean
    @ConditionalOnBean(value = {RedissonClient.class})
    public RedissonLockClient redissonLockClient(RedissonClient redissonClient, RedisTemplate redisTemplate) {
        return new RedissonLockClient(redissonClient, redisTemplate);
    }


}
